package com.pai4j.pgc.service.message.builder;
import com.pai4j.common.constants.MessageConstants;
import com.pai4j.common.enums.community.ResourceTypeEnum;
import com.pai4j.domain.vo.dto.LikeCollectMessageDTO;

import java.util.Date;

/**
 *   点赞收藏消息构造类
 *
 * @author: CYM-pai
 * @date: 2025/10/31 10:59
 **/
public class LikeCollectMessageBuilder extends AbstractMessageBuilder {

    @Override
    protected String getMessageCategory() {
        return MessageConstants.CategoryEnum.LIKE_COLLECT.getCategory();
    }

    public LikeCollectMessageDTO build(MessageConstants.TypeEnum type,
                                       String fromUserId,
                                       String toUserId,
                                       ResourceTypeEnum resourceType,
                                       String resourceId) {
        LikeCollectMessageDTO message = new LikeCollectMessageDTO();
        message.setCategory(getMessageCategory());
        message.setType(type.getType());
        message.setFromUserId(fromUserId);
        message.setToUserId(toUserId);
        message.setResourceType(resourceType.getType());
        message.setResourceId(resourceId);
        message.setCreateDate(new Date());
        return message;
    }
}
